import { BasicFetchResult } from '/@/api/model/baseModel';

export interface SubscriptionItem {
  endpoint: string;
  protocol: string;
  remark: string;
  status: string;
  subUrn: string;
  topicName: string;
  topicUrn: string;
  buttonAllowed: boolean;
}

export type records = {
  endpoint: string;
  protocol: string;
  remark: string;
  status: string;
  subUrn: string;
  records: SubscriptionItem[];
  topicName: string;
  topicUrn: string;
};

export type MessagePageParam = {
  size: number;
  current: number;
  protocol: string;
  status: string;
  endpoint: string;
};
export type MessageSubsriptionResult = BasicFetchResult<SubscriptionItem>;

export type DeleteParams = {
  subUrn: string;
};

export type EndpointList = {
  key: string;
  endpoint: string;
  remark: string;
};

export type CreateSubscriptionParams = {
  topicUrn: any;
  protocol: string;
  endpointList: EndpointList[];
};
export type RequestSubscriptionParams = {
  subUrn: string;
  endpoint: string;
  protocol: string;
};

export type CreateTopicParams = {
  displayName: string;
  topicName: string;
};
export type DeleteTopicParams = {
  topicUrn: string;
};
export type TopicPageParams = {
  topicName: string;
  current: number;
  size: string;
};
export type TopicDetailParams = {
  topicUrn: string;
  current: number;
  size: number;
};
export type DisplayNameParams = {
  topicUrn: any;
  newName: string;
};

export interface TopicDetailItem {
  displayName: string;
  // labels: Labels[];
  subscriptions: records;
  topicName: string;
  topicUrn: string;
}

export type TopicResult = BasicFetchResult<TopicDetailItem[]>;

export interface SelectTopicItem {
  topicUrn: string;
  topicName: string;
  displayName: string;
}
